<!doctype html>
<html>
<head>
	<meta charset='utf-8'/>
	<link rel="stylesheet" type="text/css" href="css/toolbar.css">
</head>
<body style='height: 3000px'>
	<section class='toolbar'>
		<ul class='toolbar_box'>
			<li class='toolbar_item'>
				<a href="javascript:;" class='toolbar_content'>
					<i class='toolbar_icon icon-bubble'></i>
					<span class='toolbar_text'>意见<br/>反馈</span>
				</a>
				<span class='toolbar_item_code'></span>
			</li>
			<li class='toolbar_item'>
				<a href="javascript:;" class='toolbar_content'>
					<i class='toolbar_icon icon-mobile'></i>
					<span class='toolbar_text'>APP<br/>下载</span>
				</a>
			</li>
			<li class='toolbar_item'>
				<a href="javascript:;" class='toolbar_content'>
					<i class='toolbar_icon icon-wechat'></i>
					<span class='toolbar_text'>公众<br/>账号</span>
				</a>
				<span class='toolbar_item_code'></span>
			</li>
			<li class='toolbar_item' id='top'>
				<a href="javascript:;" class='toolbar_content'>
					<i class='toolbar_icon icon-point-up'></i>
					<span class='toolbar_text'>返回<br/>顶部</span>
				</a>
			</li>
		</ul>
	</section>

	<script type="text/javascript">
		window.onload = function(){
			var top = document.getElementById('top');
			top.addEventListener('click',function(event){
				var stop = document.body.scrollTop;
				scrollToTop(stop/50,top);
			},false);

			window.onscroll = function(){
				var s = document.documentElement.scrollTop || document.body.scrollTop;
				if(s > 50){
					top.style.display = 'block';
				}else{
					top.style.display = 'none';
				}
			}
		};

		function scrollToTop(dec,top){
			var scroll = setInterval(function(){
				document.body.scrollTop -= dec;
				if(document.body.scrollTop == 0){
					clearInterval(scroll);
				}
			},1);
		}
		
	</script>
</body>
</html>